package com.abvnet.project.water.api.web;

import com.abvnet.framework.web.controller.BaseController;
import com.abvnet.framework.web.domain.AjaxResult;
import com.abvnet.project.water.project.domain.ProjectPharm;
import com.abvnet.project.water.project.service.IProjectPharmService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/project/pharm")
public class ApiProjectPharmController extends BaseController {

    @Autowired
    private IProjectPharmService projectPharmService;

    @GetMapping("/get")
    public AjaxResult get(@RequestParam("projectId") Long projectId) {
        return AjaxResult.success(projectPharmService.selectProjectPharmByProjectId(projectId));
    }

    @PostMapping("/edit")
    public AjaxResult editSave(ProjectPharm projectPharm) {
        return toAjax(projectPharmService.updateProjectPharm(projectPharm));
    }
}
